package com.trsvax.gwthello.client.widget;

import com.google.gwt.core.client.GWT;
import com.google.gwt.i18n.client.Dictionary;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.Widget;

public class ByeWidgetWorld extends Composite {

	interface MyUiBinder extends UiBinder<Widget, ByeWidgetWorld> {
	}

	private static MyUiBinder uiBinder = GWT.create(MyUiBinder.class);

	@UiField
	ListBox listBox;

	public ByeWidgetWorld(Dictionary dictionary) {
		String[] names = dictionary.get("names").split(",");
		// sets listBox
		initWidget(uiBinder.createAndBindUi(this));
		for (String name : names) {
			listBox.addItem(name);
		}
	}
}
